package com.dacool.signature;

import junit.framework.TestCase;

public class SignatureTest extends TestCase {

	public void testSign(){
		//dacool app reg
//		http://www.dacool.com/dcmapp/api/reg.jsn
//		post:参数
//		String recommendId,
//		String mobileNo,
//		String email,
//		String pwd,
//		String region
//		
//		String sign：签名字符串

		Signature signature=new Signature();
		signature.addParam("recommendId", "2342355");
		signature.addParam("mobileNo", "13623456868");
		signature.addParam("email", "yanzheling@126.com");
		signature.addParam("pwd", "567238");
		signature.addParam("region", "beijing");

		String sign=signature.doSignature();
		//A8676F24AFAE9405F0C609A245ECD8C8
		System.out.println(sign);
		
		
		Signature verify=new Signature();
		boolean signOk=verify.verifySign(signature,sign);
		System.out.println(signOk);
	}
}
